#include <stdio.h>

int main(){
	int n;
	scanf("%d",&n);
	printf("%d 50\n",int(n/50));
	n=int(n%50);
	printf("%d 20\n",int(n/20));
	n=int(n%20);
	printf("%d 10\n",int(n/10));
	n=int(n%10);
	printf("%d 5\n",int(n/5));
	n=int(n%5);
	printf("%d 2\n",int(n/2));
	n=int(n%2);
	printf("%d 1\n",int(n/1));
	n=int(n%1);
}


